@extends("layouts.admin.master")
@section("css")
		@parent
@stop

@section('js')
		@parent
		<script type="text/javascript" src="/js/pages/order/update.js"></script>
@stop

		
@section("body")
@include("components.left-nav")
<div class="master_div">
	<div class="input_box">
		<div class="box_title">
			基本信息
		</div>
		<div class="box_content">
			<div class="input_one">
				<div class="label">姓名：</div>
				<input id="name" type="text" name="" value="{{$order['name']}}">
			</div>
			<div class="input_one">
				<div class="label">电话：</div>
				<input id="phone" type="text" name="" value="{{$order['phone']}}">
			</div>
			<div class="input_one">
				<div class="label">预约日期：</div>
				<input id="order_date" type="date" name="" value="{{$order['order_date']}}">
			</div>
			<div class="input_one">
				<div class="label">咨询渠道：</div>
				<select id="channel">
					@foreach($channels as $channel)
					<option value="{{$channel['channel_name']}}"
						@if($order['channel'] == $channel['channel_name']))
							selected
						@endif
					>{{$channel['channel_name']}}</option>
					@endforeach
				</select>
			</div>
			<div class="input_one">
				<div class="label">预约号：</div>
				<input id="order_number" type="text" name="" readonly="readonly" value="{{$order['order_number']}}">
			</div>
			<div class="input_one">
				<div class="label">预约专家：</div>
				<select id="doctor">
					@foreach($doctors as $doctor)
					<option value="{{$doctor['doctor_name']}}"
						@if($order['doctor'] == $doctor['doctor_name'])
							selected
						@endif
					>{{$doctor['doctor_name']}}</option>
					@endforeach
				</select>
			</div>
			<div class="input_one">
				<div class="label">到诊日期：</div>
				<input id="arrival_date" type="date" name="" value="{{$order['arrival_date']}}">
			</div>
			<div class="input_one">
				<div class="label">是否到诊：</div>
				<select id="is_ready">
					<option value="1" {{$order['is_ready']?'selected':''}}>已到诊</option>
					<option value="0" {{$order['is_ready']?'':'selected'}}>未到诊</option>	
				</select>
			</div>
			<div class="input_one">
				<div class="label">qq：</div>
				<input id="qq" type="text" name="" value="{{$order['qq']}}">
			</div>
			<div class="input_one">
				<div class="label">微信：</div>
				<input id="wechat" type="text" name="" value="{{$order['wechat']}}">
			</div>
		</div>
	</div>
	<div class="input_box">
		<div class="box_title">
			详细信息
		</div>
		<div class="box_content">
			<div class="input_one">
				<div class="label">年龄：</div>
				<input id="age" type="text" name="" value="{{$order['age']}}">
			</div>
			<div class="input_one">
				<div class="label">性别：</div>
				<select id="sex">
					<option value="1" {{$order['sex']?'selected':''}}>男</option>
					<option value="0" {{$order['sex']?'':'selected'}}>女</option>
				</select>
			</div>
			<div class="input_one">
				<div class="label">疾病类型：</div>
				<select id="disease_type">
					@foreach($diseases as $disease)
						<option value="{{$disease['disease_name']}}"
							@if($order['disease_type'] == $disease['disease_name'])
								selected
							@endif
						>{{$disease['disease_name']}}</option>
					@endforeach
				</select>
			</div>
			<div class="input_one">
				<div class="label">登记类型：</div>
				<select id="register_type">
					@foreach($registers as $register)
						<option value="{{$register['register_name']}}"
							@if($order['register_type'] == $register['register_name'])
								selected 
							@endif
						>{{$register['register_name']}}</option>
					@endforeach
				</select>
			</div>
			<div class="input_one">
				<div class="label">所在省份：</div>
				<select id="province">
					@foreach($provinces as $province)
						<option value="{{$province['id']}}" 
							@if($order['province_id'] == $province['id'])
								selected
							@endif
						>{{$province['province_name']}}</option>
					@endforeach
				</select>
			</div>
			<div class="input_one">
				<div class="label">所在城市：</div>
				<select id='city'>
					@foreach($citys as $city)
					<option value="{{$city['id']}}"
						@if($order['city_id'] == $city['id'])
							selected
						@endif
					>{{$city['city_name']}}</option>
					@endforeach
				</select>
			</div>
			<div class="input_one">
				<div class="label">详细地址：</div>
				<input id="address" type="text" name="" value="{{$order['address']}}">
			</div>
			<div class="input_one">
				<div class="label">回访日期：</div>
				<input id="visit_date" type="date" name="" value="{{$order['visit_date']}}">
			</div>
			<div class="input_one">
				<div class="label">咨询员：</div>
				@if(Auth::user()->role->role_name == "超级管理员" || Auth::user()->role->role_name == "管理员")
					<select id='user_name'>
						@foreach($users as $user)
						<option value="{{$user['name']}}"
							@if($order['user_name'] == $user['name'])
								selected
							@endif
						>{{$user['name']}}</option>
						@endforeach
					</select>
				@else
					<input id="user_name" type="text" name="" readonly="readonly" value="{{$order['user_name']}}">

				@endif
			</div>
			<br>
			<div class="input_one">
				<div class="label">搜索关键词：</div>
				<input id="keyword" type="text" name="" value="{{$order['keyword']}}">
			</div>
			<div class="input_one">
				<div class="label">备注：</div>
				<textarea id="remarks">{{$order['remarks']}}</textarea>
			</div>
			<div class="input_one">
				<div class="label">聊天记录：</div>
				<textarea id="record">{{$order['record']}}</textarea>
			</div>
			<div class="input_one">
				<div class="label">个案接诊记录：</div>
				<textarea id="clinical">{{$order['clinical']}}</textarea>
			</div>
			<div class="input_one">
				<div class="label">个案后续跟踪记录：</div>
				<textarea id="visit_info">{{$order['visit_info']}}</textarea>
			</div>
		</div>
	</div>
	<div class="hide_div">
		@if(Auth::user()->role->role_name == "超级管理员")
			<input id="update_status" type="hidden" name="" value="1">
		@else
			@if(Auth::user()->role->role_name == "管理员")
				<input id="update_status" type="hidden" name="" value="1">
			@else
				@if(Auth::user()->name == $order['user_name'])
					<input id="update_status" type="hidden" name="" value="2">
				@else
					<input id="update_status" type="hidden" name="" value="0">
				@endif
			@endif
		@endif
		<input id="order_id" type="hidden" name="" value="{{$order['id']}}">
	</div>
	<div class="input_box">
		<div class="box_title">
			操作
		</div>
		<div class="btn_div">
			<div id="save_btn" class="confirm_btn">
				保存
			</div>
			<div id="cancel_btn" class="cancel_btn">
				取消
			</div>
		</div>
	</div>
</div>
@stop
